#ifndef QRUNTIMEDATA_H
#define QRUNTIMEDATA_H

#include "shared_global.h"

#include <QVariant>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>

class XMLValue;

class SHAREDSHARED_EXPORT QRuntimeData
{
public:
    QRuntimeData();
    ~QRuntimeData();
    QString valueText();

    QRuntimeData & operator =(const QRuntimeData &data);

    void    setValue(const QVariant &value);
    QVariant        value();

    QString         name();
    void            setName(const QString &name);

    QString         type();
    void            setType(const QString &type);

    bool            holdOnExit();
    void            setHoldOnExit(bool hold);

    bool            needSave();
    void            setNeedSave(bool save);

    int             saveTime();
    void            setSaveTime(int time);

    QString         category();
    void            setCategory(const QString &category);

    QString         information();
    void            setInformation(const QString &information);

    void            read(QXmlStreamReader &r);
    void            write(QXmlStreamWriter &w);
    bool            isMemery();

    static  QStringList typeList();
protected:
    void    initValue();
    XMLValue*   getXmlValue();
protected:
    QVariant        m_value;
    QString         m_type;
    QString         m_name;
    QString         m_category;
    QString         m_inforation;
    bool            m_holdOnExit;
    bool            m_save;
    int             m_saveTime;
    static QStringList  m_typelist;
};



#endif // QRUNTIMEDATA_H
